package com.lfg.other;

import com.alibaba.fastjson.JSON;

import java.util.Random;

public class Random7 {


    public static void main(String[] args) {
        System.out.println("[" + JSON.toJSONString(random7()) + "]");


    }

    public static int random5() {
        Random random = new Random();
        return random.nextInt(4);
    }


    public static int random7() {
        int ret = 5 * (random5() ) + random5();//1-25  3*7=21
        while (ret > 20) {
            ret = 5 * (random5() ) + random5();
        }
        return ret%7;
    }

}
